/*
 ============================================================================
 Name		: TradeBlockAccount.h
 Author	  : spring xu
 Version	 : 1.0
 Copyright   : Your copyright notice
 Description : CTradeBlockAccount declaration
 ============================================================================
 */

#ifndef TRADEBLOCKACCOUNT_H
#define TRADEBLOCKACCOUNT_H

// INCLUDES
#include "TradeBlock.h"
#include "Control.h"
#include "TableWidget.h"
#include "TradeBlockNetwork.h"

// CLASS DECLARATION

class CTradeBlockAccount: public CTradeBlock, public MWidgetObserver, public MPushButtonObserver //,public MReqObserver
{
public:
    ~CTradeBlockAccount();

    static CTradeBlockAccount* NewL(CBaseBlock* bsBack = NULL);

    static CTradeBlockAccount* NewLC(CBaseBlock* bsBack);

private:
    CTradeBlockAccount(CBaseBlock* bsBack);

    void ConstructL();

public:
    void OnDraw(CFbsBitGc& g) const;

    void OnKeyDown(TInt keyCode);
    
    void OnMouseDown(const TPoint& aPt);
    
    void OnMouseMove(const TPoint& aPt);

    void OnMouseUp(const TPoint& aPt);

    void SizeChanged();    
    
    void ChangeFocus(TBool aFoucs, const TInt& keyCode);
    
    void BeforeBack();
    
protected:
    void AddTabs();

    void BeforeDraw(CFbsBitGc& g) const;
    
private:
    void CreateTable();
    //void CreateControls();
    void LayoutControls();
    void TransBuf(TInt n, TDes& buf);
    void AppendNetworkData();
    
public:
	void PushButtonClicked();
public:
    // from MWidgetObserver
    void UpdateScreen();
    
    void SelectOneRow(TInt aRowIndex);
    
    void LoseFocus(const TInt& keycode);
    		
private:
    CTableWidget* iTable;
        
    //CPushButton* 	iButtonMore;
};

#endif // TRADEBLOCKQUERYFUNDS_H
